<!DOCTYPE html>
<html>
{{template "head"}}
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
{{template "header"}}
{{template "menu" .  }}
    <div class="content-wrapper">
        <section class="content-header">
            <h1>
                过滤规则
            </h1>
            <ol class="breadcrumb">
                <li class="btn btn-success c-add-btn"><a href="/admin/index/">主页</a></li>
                <li class="btn btn-success c-add-btn">过滤规则管理</li>
                <a href="/admin/filterrules/new/" class="btn btn-success c-add-btn">新增规则</a>
            </ol>
        </section>

        <section class="content">
            <div class="row c-manager">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-body">
                            <div class="page-arear">
                                <ul class="pagination">
                                    <li><a href="/admin/rules/list/1">第一页</a></li>
                                    <li><a href="/admin/rules/list/{{.pre}}">上一页</a></li>
                                {{ range $i, $v := .pageList }}
                                {{ if eq $v $.page }}
                                    <li class="active"><a href="/admin/rules/list/{{$v}}">{{$v}}</a></li>
                                {{ else }}
                                    <li><a href="/admin/rules/list/{{$v}}">{{$v}}</a></li>
                                {{ end }}
                                {{ end }}
                                    <li><a href="/admin/rules/list/{{.next}}">下一页</a></li>
                                    <li><a href="/admin/rules/list/{{.pages}}">最后一页</a></li>
                                </ul>
                            </div>
                            <table id="dataList" class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr align="center">
                                    <th>ID</th>
                                    <th>规则类型</th>
                                    <th>规则名称</th>
                                    <th>规则列表</th>
                                    <th colspan="4">管理</th>
                                </tr>
                                {{range .rules}}
                                <tr>
                                    <td>{{.Id}}</td>
                                    <td>{{if eq .RuleType 0}}黑名单{{end}}{{if eq .RuleType 1}}白名单{{end}}</td>
                                    <td>{{.RuleKey}}</td>
                                    <td>{{.RuleValue}}</td>
                                    <td><a href="/admin/filterrules/edit/{{.Id}}">edit</a></td>
                                    <td><a href="/admin/filterrules/del/{{.Id}}">del</a></td>
                                </tr>
                                {{end}}
                                </thead>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>
</div>
<script src="/lib/jQuery/jquery-2.2.3.min.js"></script>
<script src="/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="/lib/datatables/jquery.dataTables.min.js"></script>
<script src="/lib/datatables/dataTables.bootstrap.min.js"></script>
<script src="/lib/adminLET2/js/app.min.js"></script>
<script src="/js/common.js"></script>
</body>
</html>
